<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>CSS表格</title>
    <style>
      table,
      th,
      td {
        border: 2px solid black;
      }
      table {
        border-collapse: collapse;
      }
      tr:nth-child(even) {
        background-color: RGB(0, 0, 0, 0.5);
      }
    </style>
  </head>
  <body>
    <table>
      <tr>
        <th>学号</th>
        <th>姓名</th>
      </tr>
      <tr>
        <th>001</th>
        <th>张三</th>
      </tr>
      <tr>
        <th>002</th>
        <th>李四</th>
      </tr>
      <tr>
        <th>003</th>
        <th>王五</th>
      </tr>
    </table>
  </body>
</html>
